package com.woniuxy.yuekeuser.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.yuekeuser.model.City;
import com.woniuxy.yuekeuser.dao.CityMapper;
import com.woniuxy.yuekeuser.service.ICityService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Freedom
 * @since 2020-11-03
 */
@Service
public class CityServiceImpl extends ServiceImpl<CityMapper, City> implements ICityService {
    @Autowired
    private CityMapper cityMapper;
    @Override
    public IPage<City> findAllCity(Page<City> cityPage, String cityName) {
        return cityMapper.findAllCity(cityPage,cityName);
    }

    @Override
    public City queryCityByCityId(int cityId) {
        return cityMapper.selectById(cityId);
    }

    @Override
    public void addCityHeat(City city) {
        cityMapper.updateById(city);
    }

    @Override
    public List<City> findAllCitys() {
        return cityMapper.findAllCitys();
    }
}
